// utils/loading.js
let loadingCount = 0

export const showLoading = () => {
  if (loadingCount === 0) {
    uni.showLoading({
      title: '加载中...',
      mask: true
    })
  }
  loadingCount++
}

export const hideLoading = () => {
  if (loadingCount <= 0) return
  loadingCount--
  if (loadingCount === 0) {
    uni.hideLoading()
  }
}